package y9.client.platform.org;

import java.util.List;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import net.risesoft.api.org.OrgEventApi;
import net.risesoft.model.MessageOrg;
import net.risesoft.pojo.Y9Result;

/**
 * 同步组织事件组件
 *
 * @author dingzhaojun
 * @author qinman
 * @author mengjuhua
 * @date 2022/2/10
 * @since 9.6.0
 */
@FeignClient(contextId = "OrgEventApiClient", name = "y9platform", url = "${y9.common.orgBaseUrl}", path = "/services/rest/orgEvent")
public interface OrgEventApiClient extends OrgEventApi {

    /**
     * 根据机构id，获取整个组织机构数据
     *
     * @param tenantId 租户id
     * @param organizationId 机构id
     * @return Y9Result&lt;MessageOrg&gt; 整个组织机构对象集合
     * @since 9.6.0
     */
    @Override
    @GetMapping("/getSyncMap")
    Y9Result<MessageOrg> getSyncMap(@RequestParam("tenantId") String tenantId, @RequestParam("organizationId") String organizationId);

    /**
     * 获取全部事件列表
     *
     * @param tenantId 租户id
     * @return Y9Result&lt;List&lt;MessageOrg&gt;&gt; 全部事件列表
     * @since 9.6.0
     */
    @Override
    @GetMapping("/listAllEvents")
    Y9Result<List<MessageOrg>> listAllEvents(@RequestParam("tenantId") String tenantId);

    /**
     * 获取当天的事件列表
     *
     * @param tenantId 租户id
     * @param appName 应用名称
     * @return Y9Result&lt;List&lt;MessageOrg&gt;&gt; 当天事件列表
     * @since 9.6.0
     */
    @Override
    @RequestMapping("/listTodayEvents")
    Y9Result<List<MessageOrg>> listTodayEvents(@RequestParam("tenantId") String tenantId, @RequestParam("appName") String appName);

}
